<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>92Play后台管理</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/managercss.css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.form.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/validate.js"></script>
<script type="text/javascript">
	var ctp = '<%=request.getContextPath() %>';
	$(function(){
		$("#add").click(function(){
			var mobileTypeName = $("#mobileTypeName").val();
			var mobileWidth = $("#mobileWidth").val();
			var mobileHeight = $("#mobileHeight").val();
			var softwareVersion = $("#softwareVersion").val();
			if(isNull(mobileTypeName)){
				alert("请输入机型名称!");
				$("#mobileTypeName").focus();
				return;
			}else if(isNull(mobileWidth)||!isNum(mobileWidth)){
				alert("请输入正确的宽度!");
				$("#mobileWidth").focus();
				return;
			}else if(isNull(mobileHeight)||!isNum(mobileHeight)){
				alert("请输入正确的高度!");
				$("#mobileHeight").focus();
				return;
			}else if(isNull(softwareVersion)){
				alert("请输入软件版本号!");
				$("#softwareVersion").focus();
				return;
			}else{
				var date = $("#mobileForm").formSerialize();
				$.ajax({
					url:ctp+"/admin/mobile/add",
					data:date,
					type:"POST",
					success:function(flag){
						if(flag=='1'){
							alert("添加成功!");
							//window.location.href= ctp+"/admin/mobile/${company.companyId}";
							 parent.location.reload();
						}else{
							alert("添加失败!");
						}
					}
				});
				return;
			}
		});
	});
</script>
</head>
<body>
<div class="information">
	<div class="title">
		厂商==>${company.companyName }==>机型管理==>添加机型
	</div>
	<div class="list">
		<form method="post" id="mobileForm">
		<input type="hidden" name="companyId" id="companyId" value="${company.companyId }">
		<div class="noselect">
			<ul>
				<li style="width: 100px;text-align: right;">机型名称：</li>
				<li style="width: 300px;text-align: left;">
					<input type="text" name="mobileTypeName" id="mobileTypeName" value="" size="20"></input>
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">宽度：</li>
				<li style="width: 300px;text-align: left;">
					<input type="text" name="mobileWidth" id="mobileWidth"  size="20"/>
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">高度：</li>
				<li style="width: 300px;text-align: left;">
					<input type="text" name="mobileHeight" id="mobileHeight" size="20">
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">软件版本：</li>
				<li style="width: 300px;text-align: left;">
					<input type="text" name="softwareVersion" id="softwareVersion" size="20">
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">&nbsp;</li>
				<li style="width: 300px;text-align: left;">
					<input type="button" id="add" value="提 交" /> 
				</li>
			</ul>
			<div class="clear"></div>
		</div>
		</form>
	</div>
</div>
</body>
</html>